<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /**
         *  什么是回调函数：函数的参数是函数，参数函数在函数内部调用
         * 
         * 
         */
        function dating(fn){
            console.log('吃饭');
            fn && fn();
            // if(fn){
            //     fn();
            // }
        }

        function movie(){
            console.log('看电影');
        }

        dating();

        dating(movie);

        var arr = [1,2,3,4];

        arr.sort(function(a,b){

        })

        

    </script>
</body>
</html>